package co.fitstart.entity.market;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/** 
 * 打卡课程
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "market_course")
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class MarketCourse {
    
    @Id
    @GeneratedValue
    private Long id;
    
    /** 课程名称 */
    private String name;
    
    /** 课程描述 */
    @Type(type = "text")
    private String description;
    
    /** 月数 */
    private int months;
    
    /** 封面 */
    private String cover;
    
    /** 难度系数 */
    private int difficulty;
    
    /** 课程等级 */
    private CourseLevel courseLevel;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public MarketCourse() {
        
    }
    
    /**
     * 
     * @return
     */
    public MarketCourse initilization() {
        this.months = 4;
        return this;
    }
    
    /**
     * 
     * @return
     */
    public MarketCourse disable() {
        this.disabled = true;
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the months
     */
    public int getMonths() {
        return months;
    }

    /**
     * @return the cover
     */
    public String getCover() {
        return cover;
    }

    /**
     * @return the difficulty
     */
    public int getDifficulty() {
        return difficulty;
    }

    /**
     * @return the courseLevel
     */
    public CourseLevel getCourseLevel() {
        return courseLevel;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param months the months to set
     */
    public void setMonths(int months) {
        this.months = months;
    }

    /**
     * @param cover the cover to set
     */
    public void setCover(String cover) {
        this.cover = cover;
    }

    /**
     * @param difficulty the difficulty to set
     */
    public void setDifficulty(int difficulty) {
        this.difficulty = difficulty;
    }

    /**
     * @param courseLevel the courseLevel to set
     */
    public void setCourseLevel(CourseLevel courseLevel) {
        this.courseLevel = courseLevel;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
